package 博客;

import java.util.ArrayList;
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"兽宝一号","兽宝二号","兽宝三号");
        System.out.println("正常遍历");
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }


        System.out.println("增强for");
        for(String s:list){
            System.out.println(s);
        }
    }
}
